package com.cyzy.controller;

import com.cyzy.domain.dto.ResponseData;

import com.cyzy.domain.query.TPlantQuery;
import com.cyzy.domain.vo.TPlantVo;
import com.cyzy.service.PlantService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
public class PlantController {
    @Autowired
    private PlantService plantService;
//    查询数据        redis没有插入
    @PostMapping("/data")
    public ResponseData select(@RequestBody TPlantQuery tPlantQuery){
        return plantService.select(tPlantQuery);
    }
//    查询id
    @PostMapping("/id")
    public ResponseData id(@RequestBody TPlantVo tPlantVo){
        return plantService.id(tPlantVo);
    }
//    点击人数加一
    @PostMapping("/num")
    public ResponseData num(@RequestBody TPlantVo tPlantVo){
        return plantService.num(tPlantVo);
    }
}
